/*
	Copyright (C) 2008 by Jean-François Geyelin
	jfgeyelin@gmail.com

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the
	Free Software Foundation, Inc.,
	51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/

#include "all.h"
#include "SplittedSurface.h"

class SurfaceHandler {
	public:
        static int SDL_BlitSurface(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);
        static void drawSurface(SDL_Surface *surface, int x, int y, SDL_Surface *destination);
    	static void drawSurface(SDL_Surface *surface, int x, int y);
      	static void drawSurface(SDL_Surface *surface, float x, float y);
      	static SDL_Surface * loadImage( std::string filename );
      	static void convertToGrayscale(SDL_Surface *surface);
      	static void sliceSurface(SDL_Surface *source, SDL_Surface **surfaces, SDL_Rect *rect, int n);
      	static void quickSliceSurface(std::string name, SDL_Surface ***surfaces, int n);
      	static void quickSliceSurface(std::string name, SDL_Surface ***surfaces, int w, int n);
      	static void quickSliceSurface(std::string name, SDL_Surface ***surfaces, int w, int h, int n);
      	static int quickSliceSurface2(std::string name, SDL_Surface ***surfaces, int w, int h);
		static void quickSliceSurface(std::string name, SDL_Surface ***surfaces, int n, SDL_Rect *r);
      	static void putpixel(int x, int y);
      	static void putpixel2(int x, int y);
      	static void safePutpixel(int x, int y);
      	static void freeSurfaces(SDL_Surface ***s, int n);
      	static void getPixel(SDL_Surface *s, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b);
      	static void putpixel3(SDL_Surface *surface, int x, int y, Uint32 pixel);
      	static void colorScreen(Uint32 color);
      	static void colorScreen(Uint8 r, Uint8 g, Uint8 b);
      	static void colorSurface(SDL_Surface *s, Uint32 color);
        static void colorSurface(SDL_Surface *s, Uint8 r, Uint8 g, Uint8 b);
        static void replaceColor(SplittedSurface *ss, Uint8 r1, Uint8 g1, Uint8 b1, Uint8 r2, Uint8 g2, Uint8 b2);
        static void replaceColor(SDL_Surface *surface, Uint8 r1, Uint8 g1, Uint8 b1, Uint8 r2, Uint8 g2, Uint8 b2);
        static void inverseColor(SDL_Surface *surface);
};
